<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<title>Marshal syntax</title>
	</head>
	<body>
		<h1>Marshal syntax</h1>
		<p>
		Data class Object provides the native method marshal. It returns a string representation of the receiver. The inverse functionality is implemented as method unmarshal in class String. The string representation of an object is in the xml format. And has the following rules:
		<ol>
		<li>Each instance of an object in the dependency tree of the marshalled object has a unique identifier.
		<li>In the root node, the id is given of represented object.
	<pre>
	&lt;poosl_marshal_data root="1"&gt;
	</pre>
		
		<li>Each object, primitive or non-primitive is a node in the XML tree.
	<pre>
	&lt;object id="1" class="CustomObject"&gt;
		&lt;assignments&gt;
			&lt;assignment name="Aap" id="2"/&gt;
		&lt;/assignments&gt;
	&lt;/object&gt;
	</pre>
			
		<li>Primitive objects and "String" can have a value:
	<pre>
	&lt;object id="2" class="String"&gt;
		&lt;value>aap&lt;/value&gt;
	&lt;/object&gt;
	</pre>
		This also applies to sub-classes from "String"
		
		<li>The content of an array (or sub-class) is a list of assignments with '#m"' as id, where m  is a positive Integer constant.
	<pre> 
	&lt;object id="4" class="Array"&gt;
		&lt;assignments&gt;
			&lt;assignment name="#1" id="3"/&gt;
			&lt;assignment name="#2" id="6"/&gt;
		&lt;/assignments&gt;
	&lt;/object&gt;
	</pre> 
		</ol>
		</p>
		<p>
		An example of a marshalled object (CustomObject):
	<pre>
	&lt;poosl_marshal_data root="1"&gt;
		&lt;object id="1" class="CustomObject"&gt;
			&lt;assignments&gt;
				&lt;assignment name="Aap" id="2"/&gt;
				&lt;assignment name="Noot" id="4"/&gt;
			&lt;/assignments&gt;
		&lt;/object&gt;
		&lt;object id="2" class="String"&gt;
			&lt;value>aap&lt;/value&gt;
		&lt;/object>
		&lt;object id="5" class="Boolean"&gt;
			&lt;value>true&lt;/value&gt;
		&lt;/object&gt;
		&lt;object id="3" class="CustomString"&gt;
			&lt;assignments&gt;
				&lt;assignment name="test" id="4"/&gt;
			&lt;/assignments&gt;
			&lt;value>noot&lt;/value&gt;
		&lt;/object&gt;
		&lt;object id="4" class="Array"&gt;
			&lt;assignments&gt;
				&lt;assignment name="#1" id="3"/&gt;
				&lt;assignment name="#2" id="6"/&gt;
				&lt;assignment name="#3" id="5"/&gt;
			&lt;/assignments&gt;
		&lt;/object&gt;
		&lt;object id="6" class="Nil"&gt;
		&lt;/object&gt;
	&lt;/poosl_marshal_data&gt;
	</pre>
		</p>
	</body>
</html>